package com.lionxing.DNTG;

import org.cocos2d.layers.CCLayer;
import org.cocos2d.layers.CCScene;
import org.cocos2d.menus.CCMenu;
import org.cocos2d.menus.CCMenuItemImage;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.types.CGPoint;
import org.cocos2d.types.CGSize;

public class helpLayer extends CCLayer {
	
	
	public static CCScene scene() {
		CCScene scene = CCScene.node();
		helpLayer layer = new helpLayer();

		scene.addChild(layer);
		
		return scene;
	}
	
	
	protected helpLayer()
	{
		CGSize size = CCDirector.sharedDirector().winSize();
		CCSprite bgSp = CCSprite.sprite("help.png");
		
		
		bgSp.setScaleX((size.width/GameDefine.KIos_W));
		bgSp.setScaleY((size.height/GameDefine.KIos_h));
		bgSp.setPosition(CGPoint.make(size.width/2, size.height/2));
		
		addChild(bgSp,-1);
				
		
		CCMenuItemImage menuitemback = CCMenuItemImage.item("back.png", "back2.png",this, "gotoBack");
		CCMenu menuBack = CCMenu.menu(menuitemback);
		menuBack.setPosition(CGPoint.make(267, 36));
		bgSp.addChild(menuBack);
		
		
	}
	
	public void gotoBack(Object sender)
	{
		playSound.sharedDirector().playEffectSound(R.raw.kick);
		CCScene scene = MainLayer.scene();
		// CCDirector.sharedDirector().replaceScene(scene);
		 scenemanager.go(scene);
	}

	
	 public  void onExit()
		{		
				this.removeAllChildren(true);
				super.onExit();
		}
}
